export const getBarOption = function (chartDataX,chartDataY) {
  const option = {
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow'
      }
    },
    grid: {
      left: '8%',
      right: '8%',
      bottom: '12%',
      containLabel: true
    },
    xAxis: [
      {
        type: 'category',
        data: chartDataX,
        axisLabel: {
            interval: 0,
            rotate: -45
        },
        axisTick: {
          alignWithLabel:true,
          show: true, //是否展示刻度线
          inside: true //刻度线朝内还是朝外
        }
      }
    ],
    dataZoom : [
      {
        show: true, //是否显示滑动条
        type: "slider", // 这个 dataZoom 组件是 slider 型 dataZoom 组件
        xAxisIndex: [0],
        startValue: 0, // 从头开始。
        bottom:20
      }
          
    ],
    yAxis: [
      {
        type: 'value'
      }
    ],
    series: [
      {
        type: 'bar',
        barWidth: '30',
        itemStyle: {
          color:'#f99b35'
        },
        data: chartDataY
      }
    ]
  } 
  return option
};
